<?php


namespace app\applet\controller;


use app\BaseController;
use think\facade\Db;


class Parking extends BaseController
{
    public function getParkingIdByAppId(){
        $clientType=request()->header("clientType");
        $appid=request()->get("appId");
        $res=Db::table("parkinglotinfo")->where("wechat_appid",$appid)
            ->field("parkingNo")
            ->find();
        if($clientType=="ALIPAY_MP"){
            $res=Db::table("parkinglotinfo")->where("alipay_appid",$appid)
                ->field("parkingNo")
                ->find();
        }
        if(!empty($res)){
            return json(["code"=>0,'data' => $res]);
        }else{
            return json(["code"=>501,'msg' => "车场信息不存在"]);
        }
    }
}